//
//  USerModel.m
//  Lmm_IOS
//
//  Created by 张哲炜 on 2018/9/15.
//  Copyright © 2018年 lmm. All rights reserved.
//

#import "UserModel.h"

@implementation UserModel


- (void)encodeWithCoder:(nonnull NSCoder *)aCoder {
    [aCoder encodeInt:self.id forKey:@"id"];
    [aCoder encodeObject:self.mobile forKey:@"mobile"];
    [aCoder encodeObject:self.nickname forKey:@"nickname"];
    [aCoder encodeObject:self.token forKey:@"token"];
    [aCoder encodeObject:self.avatar forKey:@"avatar"];
    [aCoder encodeInt:self.sex forKey:@"sex"];
    [aCoder encodeInt:self.points forKey:@"points"];
    [aCoder encodeInt:self.history_points forKey:@"history_points"];
    [aCoder encodeObject:self.address forKey:@"address"];
    [aCoder encodeInt:self.risk_check forKey:@"risk_check"];
    
}

- (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder {
   if(self =[super init]){
       self.id = [aDecoder decodeIntForKey:@"id"];
       self.mobile = [aDecoder decodeObjectForKey:@"mobile"];
       self.nickname = [aDecoder decodeObjectForKey:@"nickname"];
       self.token = [aDecoder decodeObjectForKey:@"token"];
       self.avatar = [aDecoder decodeObjectForKey:@"avatar"];
       self.sex = [aDecoder decodeIntForKey:@"sex"];
       self.points = [aDecoder decodeIntForKey:@"points"];
       self.history_points  = [aDecoder decodeIntForKey:@"history_points"];
       self.address = [aDecoder decodeObjectForKey:@"address"];
       self.risk_check = [aDecoder decodeIntForKey:@"risk_check"];
       
   }
    return self;
}

@end
